Linux Cat and echo command detailed cat command is a text output command under Linux, usually for viewing the contents of a file; Cat has three main functions:1. Displays the entire file at once. $ cat FileName2. Create a file from the keyboard. $
EOF
EOF (end of file) is a status returned by the file read operation. It is not a value read from the file, instead, it is a return value when the file reading function reads the end Of the file or cannot read down. The returned value is generally-1
In some cases, we might need to generate a temporary file in the script and then put the file in the directory as the final file. (You can refer to the Ntop.spec file) There are several benefits, one of which is that temporary files are not unique,
SenarioEnter sqlcmd with: Out XXX generate Data file, because sqlcmd export to file by default Chinese garbled, so with the-u (Unicode) switch@echo off & setLocal enabledelayedexpansion:start@set db=adventureworks2012sqlcmd -d%db%-b-iscript.sql-v
In some cases, we might need to generate a temporary file in the script and then put the file in the directory as the final file. (You can refer to the Ntop.spec file) There are several benefits, one of which is that temporary files are not unique,
1, cat >file record is keyboard input, equivalent to create a file from the keyboard, and can only create new files, cannot edit existing files. > is a data redirection that outputs the text content you enter into file.2. Cat The cat command is a
What is here DocumentHere Document is a special redirection method in the Linux Shell, and its basic form is as followsCMD Its role is to pass the contents of the two delimiter (hereDocument content section) to cmd as input parameters.For example,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.